#if !defined(_SNUMBER_H)
#define _SNUMBER_H

#include "SSimpleValue.h"
#include "boost/lexical_cast.hpp"
#include <boost/regex.hpp>

CREATE_ALIAS( SNumber )

/**
 *   Class used to store a numeric value.
 */
class DECLARATION_DLL SNumber : public SSimpleValue
{
	/** The numeric value. */
	unsigned long value;

	/**
	 *  Create a SNumber variable with a specific value.
	 */
	SNumber(unsigned long value)
	{
		Set(value);
	}

	public:

		/** Get the variable type. */
		virtual SType GetType() const
		{
			return STypeNumber;
		}

		/**
		 *   Set the numeric value.
		 */
		virtual void Set(unsigned long value) 
		{ 
			this->value = value;
		}
		
		/**
		 *   Get the numeric value.
		 */
		virtual unsigned long Get() 
		{ 
			return value; 
		}

		/**
		 * Returns a string representation of the value.
		 */
		virtual string ToString() 
		{ 
			return SSimpleValue::ToString(); 
		}

		/**
		 * Returns a string representation of the value in a specific format.
		 */
		virtual string ToString(string format);

		/**
		 *   Factory method to create a SNumber variable.
		 */
		static SNumberSp Create(unsigned long value);

		/**
		 *   Factory method to create a SNumber variable from a string.
		 */
		static SNumberSp Parse(string s);
};

#endif  //_SNUMBER_H
